package hoowin.common.service;

import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSenderImpl;

public class MailService {
	private JavaMailSenderImpl mailSender;
	private SimpleMailMessage mailMessage;
	
	public void sendSimpleMail(String subject, String content, String address){
		mailMessage.setSubject(subject);
		mailMessage.setText(content);
		mailMessage.setTo(address);
		mailSender.send(mailMessage);
	}
	
	public void setMailSender(JavaMailSenderImpl mailSender) {
		this.mailSender = mailSender;
	}
	public JavaMailSenderImpl getMailSender() {
		return mailSender;
	}
	public void setMailMessage(SimpleMailMessage mailMessage) {
		this.mailMessage = mailMessage;
	}
	public SimpleMailMessage getMailMessage() {
		return mailMessage;
	}
}
